package lab02.test21;

/**
 * Created by 婷婷 on 2017/11/1.
 */
public class Test21 {
    public static void main(String[] args) {


        int count = 0;
        String characterString = "sunshine";
        char [] characterStringArray = characterString.toCharArray();
        for (int i = 0;i<characterStringArray.length;i++){
            if (characterStringArray[i] == 's'){
                count++;
            }
        }
        System.out.println("在字符串sunshine中，给定字符s的出现频率是："+count);
    }
}
